import request from "../../../utils/request.ts"
import type { TradeMarkData, TradeMark} from "./type.ts"
enum API{
    TRADEMARK_URL="/admin/product/baseTrademark/",
    //添加接口
    ADDTRADEMARK_URL="/admin/product/baseTrademark/save",
    //修改
    UPDATETRADEMARK_URL="/admin/product/baseTrademark/update"
}
export const reqHasTrademark = (page:number,limit:number) => request.get<any,TradeMarkData>(API.TRADEMARK_URL + `${page}/${limit}`)
export const reqAddOrUpdateTrademark = (data:TradeMark) => {
    if(data.id){
        return request.put<any,any>(API.UPDATETRADEMARK_URL,data)
    }else{
        return request.post<any,any>(API.ADDTRADEMARK_URL,data)
    }
}